package com.dianjing.dianqun.common;

import java.util.Date;

/**
 * 返回api的包装类
 * 
 * @author baoyongtao
 *
 */
public class ResponseData implements java.io.Serializable {

	public static final Integer STATUS_OK = 0; // 成功
	public static final Integer STATUS_ERROR = -1;// 失败

	/**
	 * api前端返回接口包装类
	 */
	private static final long serialVersionUID = 1L;
	// 返回状态码 0 1
	private Integer code;
	// 返回信息
	private String message;
	//
	@SuppressWarnings("unused")
	private Date timestamp;
	// 返回数据
	private Object data;

	public ResponseData(Integer code, String message, Object data) {
		super();
		this.code = code;
		this.message = message;
		this.data = data == null ? "" : data;
		this.timestamp = new Date();
	}
	public ResponseData() {}
	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public Date getTimestamp() {
		return new Date();
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

}
